added, do not leave the scroll timeout running if the slider buttons are
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 8 Nov 2006 19:46:56 +0000 (19:46 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Wed, 8 Nov 2006 19:46:56 +0000 (19:46 +0000)
2006-11-08  Carlos Garnacho  <carlosg@gnome.org>

        * gtk/gtkpathbar.c (on_slider_unmap): added, do not leave the scroll
        timeout running if the slider buttons are hidden. (#372527)

ChangeLog
gtk/gtkpathbar.c

index 980761546776ff65a66501e71b33e4760e54d759..66f573b586c2146bc812363f6bbf2474908c2a71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-08  Carlos Garnacho  <carlosg@gnome.org>
+
+       * gtk/gtkpathbar.c (on_slider_unmap): added, do not leave the scroll
+       timeout running if the slider buttons are hidden. (#372527)
+
 2006-11-08  Christian Persch  <chpe@cvs.gnome.org>
 
        * gtk/gtkfilechooserdefault.c (browse_widgets_create): Don't make
index 442ef7f606f17f0c43007471456b0d55b3ba5695..07631b13a6c213845e0b7752262ef694214bdc31 100644 (file)
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
 /* gtkpathbar.c
  * Copyright (C) 2004  Red Hat, Inc.,  Jonathan Blandford <jrb@gnome.org>
  *
@@ -116,6 +117,16 @@ static void gtk_path_bar_update_button_appearance (GtkPathBar       *path_bar,
                                                   ButtonData       *button_data,
                                                   gboolean          current_dir);
 
+static void
+on_slider_unmap (GtkWidget  *widget,
+                GtkPathBar *path_bar)
+{
+  if (path_bar->timer &&
+      (widget == path_bar->up_slider_button && path_bar->scrolling_up) ||
+      (widget == path_bar->down_slider_button && path_bar->scrolling_down))
+     gtk_path_bar_stop_scrolling (path_bar);
+}
+
 static GtkWidget *
 get_slider_button (GtkPathBar  *path_bar,
                   GtkArrowType arrow_type)
@@ -130,6 +141,9 @@ get_slider_button (GtkPathBar  *path_bar,
   gtk_container_add (GTK_CONTAINER (path_bar), button);
   gtk_widget_show_all (button);
 
+  g_signal_connect (G_OBJECT (button), "unmap",
+                   G_CALLBACK (on_slider_unmap), path_bar);
+
   gtk_widget_pop_composite_child ();
 
   return button;